<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.chilli.cosima.action.I18nAction" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="/struts-dojo-tags" prefix="sx"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
	<head>
		<base href="<%=basePath%>" />
		<title>Insert title here</title>
		<link href="css/validate.css" rel="stylesheet" type="text/css" />
		<link href="css/common.css" rel="stylesheet" type="text/css" />
		<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
		<script src="js/css.js" type="text/javascript"></script>
		<script src="js/common.js" type="text/javascript"></script>
		<script src="js/validator.js" type="text/javascript"></script>

	</head>
	<body>
		<div id="man_zone">
		<s:form name="form" id="form" action="customer/customerQueryQueryAction.action" enctype ="multipart/form-data" theme="simple">
		<div class="navbar">
			客户管理 > 客户查询
		</div>
		<div class="toolbar">
			<input type="submit" value="查询" class="button_60" onMouseOver="this.className='button_60_over'" onMouseOut="this.className='button_60'"/>
			<input type="button" value="返回" onclick="javascript:history.back(-1)" class="button_60" onMouseOver="this.className='button_60_over'" onMouseOut="this.className='button_60'"/>
				
		</div>			
		<div class="main_content" >
		<s:textfield name="input" require="true" datatype="limit" min="1"
                    max="50" msg='<%=I18nAction.getInstance().getResource("user.length", new String[]{"1", "50"}) %>' /><span style="color:red">*</span>
		</div>
		</s:form>
	</div>
	</body>
	<script language="javascript">
		$().ready(function() {
			$('form').checkForm(1);
		});

		$('#password').blur(function(){
			ShowStrong();
		 });
		 
		function CharMode(iN)
		{
			if (iN>=65 && iN <= 90)
				return 2;
			if (iN>=97 && iN <= 122)
				return 4;
			else
				return 1;
		}

		function bitTotal(num)
		{
			modes = 0;
			for(i=0; i<3; i++)
			{
				if (num & 1) modes++;
				num >>>= 1;
			}
			return modes;
		}

		function checkStrong(sPW)
		{
			Modes=0;
	
			for (i=0;i<sPW.length;i++)
			{
				//测试每一个字符的类别并统计一共有多少种模式.
				Modes|=CharMode(sPW.charCodeAt(i));
			}
			
			var btotal = bitTotal(Modes);
			if (sPW.length >= 10) btotal++;

			switch(btotal) 
			{
				case 1:
					return "pw_check_1";
					break;
				case 2:
					return "pw_check_2";
					break;
				case 3:
					return "pw_check_3";
					break;
				default:
					return "pw_check_1";
			}
		}

		function ShowStrong()
		{
			var data = checkStrong($('#password').val());
			pw_id = '#' + data;
			$(".pw_check").hide();
			$(pw_id).show();
		}
	</script>
</html>